<?php

class Core_Model_Media_Ebook_Material extends Dcmp_Model_Entity {

    public function __construct() {
        parent::__construct();
    }

    public function getPois(){
        return App::getModel('foundation/collection_poi')
                    ->filterByPoiIds($this->getPoiIds());
    }

    protected function initializeTable($table) {
        $table->setName('{t}media_ebook_material');
        $table->createColumn('id', 'integer', TRUE, TRUE);
        $table->createColumn('title', 'string');
        $table->createColumn('poi_ids', 'array');
        $table->createColumn('road_id', 'string');
        $table->createColumn('industry_id', 'string');
        $table->createColumn('poi_page_size', 'integer')->setDefaultValue(8);
        $table->createColumn('is_maked', 'integer')->setDefaultValue(0);
    }
}